import React, { Component } from 'react';
import Tabbar from './components/tabbar/Tabbar';
import { HashRouter as Router, Route, Switch, Redirect } from 'react-router-dom';

import Home from './components/home/Home';
import Category from './components/category/Category';
import Buy from './components/buy/Buy';
import Car from './components/car/Car';
import Personal from './components/personal/Personal';
import OrderDetils from './components/orderDetails/OrderDetils';
import Login from './components/login/login';



function App() {
  return (
    <div>
      <Router>
        <Switch>
          <Route exact path="/home" render={(props) => <Tabbar {...props}><Home></Home></Tabbar>}></Route>
          <Route exact path="/category" render={(props) => <Tabbar {...props}><Category></Category></Tabbar>}></Route>
          <Route exact path="/buy" render={(props) => <Tabbar {...props}><Buy></Buy></Tabbar>}></Route>
          <Route exact path="/car" render={(props) => <Tabbar {...props}><Car  {...props}></Car></Tabbar>}></Route>
          <Route exact path="/personal" render={(props) => <Tabbar {...props}><Personal></Personal></Tabbar>}></Route>
          <Route exact path="/orderDetils" render={(props) => <OrderDetils {...props}></OrderDetils>}></Route>

          <Route exact path="/login" render={(props) => <Tabbar {...props}><Login></Login></Tabbar>}></Route>
          {/* <Route exact path="/personal" render={(props)=><Tabbar {...props}><Personal></Personal></Tabbar>}></Route> */}
          <Redirect to="/home"></Redirect>
        </Switch>
      </Router>
    </div>
  );
}

export default App;
